<?php

namespace App\Jobs;

use GatewayClient\Gateway;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class ProcessPodcast implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        Gateway::$registerAddress = '127.0.0.1:8282';
        $data = json_encode(['id' => '12', 'name' => 'admin']);
        $client_id = "7f0000010b5700000001";
        //业务逻辑
        Gateway::sendToClient($client_id, $data);
//        Gateway::sendToAll());
    }
}
